package org.example.common;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import org.example.pojo.vo.MenuVo;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;
import java.util.List;

/**
 * 自动逸权限认证返回实体类
 */

@Getter
@ApiModel(description = "自动逸权限认证返回实体类")
public class LoginUserDetail extends User {

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id", position = 1)
    private String userId;

    /**
     * 菜单集合
     */
    @ApiModelProperty(value = "菜单集合", position = 2)
    private List<MenuVo> menus;

    /**
     * 权限集合
     */
    @ApiModelProperty(value = "权限集合", position = 3)
    private List<String> permission;


    public LoginUserDetail(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }


    public void setMenus(List<MenuVo> menus) {
        this.menus = menus;
    }

    public void setPermission(List<String> permission) {
        this.permission = permission;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

}
